<?php
  // Php que me permite activar un usuario que ha pulsado el link
  // Carga de clases
  require_once ("C_krn_consts.php");
  require_once ("C_krn_tools.php");
  require_once ("C_krn_exception.php");
  require_once ("C_krn_crypt.php");
  require_once ("C_krn_bd.php" );
  
  if (isset($_GET ['id'])) {
	  // Desencripto los datos
		$id = $_GET ['id'];
				
		$id = trim(mysql_real_escape_string( $id ));
		
		global $cCRYPT;
		global $BD;
		global $cAUDIT;
		global $IDIOMA, $language;
				
		$cAUDIT->AddAudit ( AUDIT_APP, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, $language [$IDIOMA] [106] . $id ); 
       
		$cadena_decrypt = $cCRYPT->getDECRYPT( $id );
		$ret = $BD->ActivarUser ( $cadena_decrypt );
     
		// Si se ha hecho un cambio
		if ($ret == 1) {
		  $cAUDIT->AddAudit ( AUDIT_APP, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, $language [$IDIOMA] [106] . $cadena_decrypt . " [ $id ] --> ok" ); 
		  echo "How is it going?<br />";
		  echo "Yeahhhh, User $cadena_decrypt activation ok<br />";
			echo " <br />";
			echo " Interactua Development,<br />";
			echo " ".APPLICATION_WEB_DOMAIN."<br />";
			echo " <br />";
		  echo "Thanks";
		} else {
		  $cAUDIT->AddAudit ( AUDIT_APP, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, $language [$IDIOMA] [106] . $cadena_decrypt . " [ $id ] --> fail" ); 
		  echo "How is it going? ... Uppps";		
		}
	} else {
	  $cAUDIT->AddAudit ( AUDIT_APP, __DIR__, __FILE__, __LINE__, __CLASS__, __METHOD__, __FUNCTION__, $language [$IDIOMA] [106] . " [ $id ] --> fail (no id)" ); 
		echo "How is it going? ... Uppps";
  }
?>
